package pcsr.simulator.control;

public abstract class ControlSimulatorNestedComponent extends ControlSimulatorComponent {

	protected ControlSimulatorStructure parent;
	
	protected int xDeltaPosition;
	protected int yDeltaPosition;
	
	public ControlSimulatorNestedComponent(String ID, ControlSimulatorStructure chassis)
	{
		super(ID);
		parent = chassis;
	}
	
	void updatePosition()
	{
		this.setXPos(parent.GetXPos() + xDeltaPosition);
		this.setYPos(parent.GetYPos() + yDeltaPosition);
	}
	
	int getXDeltaPosition()
	{
		return this.xDeltaPosition;
	}
	
	int getYDeltaPosition()
	{
		return this.yDeltaPosition;
	}
	
	void setXDeltaPosition(int xDelta)
	{
		this.xDeltaPosition = xDelta;
	}
	
	void setYDeltaPosition(int yDelta)
	{
		this.yDeltaPosition = yDelta;
	}
}
